{
 "cells": [
  {
   "cell_type": "raw",
   "id": "bad5fba6",
   "metadata": {},
   "source": [
    "航空公司乘客满意度预测\n",
    "通过用户信息来判断未来提供的服务能不能使乘客满意\n",
    "目标列：satisfaction  表示：1满意、2不满意或中立\n",
    "\n",
    "Unnamed: 0', \n",
    "'id', \n",
    "'Gender', 性别:男性或女性\n",
    "'Customer Type',   客户类型:定期或非定期航空公司客户\n",
    "'Age',   年龄:乘客的实际年龄\n",
    "'Type of Travel',  旅行类型:乘客的飞行目的(个人或商务旅行)\n",
    "'Class',   舱位:商务、经济、经济+\n",
    "'Flight Distance',   飞行距离\n",
    "'Inflight wifi service',   机上 wifi 服务:对机上 Wi-Fi服务的满意度(0:未评分;1-5)\n",
    "'Departure/Arrival time convenient',  出发/到达时间方便:出发/到达时间满意度(0:未评分;1-5)\n",
    "'Ease of Online booking',   在线预订的难易程度:在线预订满意度(0:未评分;1-5)\n",
    "'Gate location',     浇口位置:对浇口位置的满意度(0:未评分;1-5)\n",
    "'Food and drink',    饮食:饮食满意度(0:未评分;1-5)\n",
    "'Online boarding',    在线登机:对在线登机的满意度(0:未评分;1-5)\n",
    "'Seat comfort',     座椅舒适度:座椅满意度(0:未评分;1-5)\n",
    "'Inflight entertainment',   机上娱乐:对机上娱乐的满意度(0:未评分;1-5)\n",
    "'On-board service',   机上服务:对机上服务的满意度(0:未评分;1-5)\n",
    "'Leg room service',   腿部客房服务:对腿部客房服务的满意度(0:未评分;1-5)\n",
    "'Baggage handling',   行李处理:对行李处理的满意度(0:未评分;1-5)\n",
    "'Checkin service',    入住服务:对入住服务的满意度(0:未评分;1-5)\n",
    "'Inflight service',   机上服务:对机上服务的满意度(0:未评分;1-5)\n",
    "'Cleanliness',       清洁度:对清洁度的满意程度(0:未评分;1-5)\n",
    "'Departure Delay in Minutes',  出发延误分钟\n",
    "'Arrival Delay in Minutes',   到达延迟分钟\n",
    "'satisfaction'      航空乘客满意度 满意(1)中立或不满意(2)    分类目标列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "62242bc4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6bb64035",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>id</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Class</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>70172</td>\n",
       "      <td>Male</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>13.0</td>\n",
       "      <td>Personal Travel</td>\n",
       "      <td>Eco Plus</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>5047</td>\n",
       "      <td>Male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>235</td>\n",
       "      <td>3</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>110028</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>1142</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>24026</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>562</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>119299</td>\n",
       "      <td>Male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>214</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0      id  Gender   Customer Type   Age   Type of Travel  \\\n",
       "0           0   70172    Male  Loyal Customer  13.0  Personal Travel   \n",
       "1           1    5047    Male             NaN  25.0  Business travel   \n",
       "2           2  110028  Female             NaN  26.0  Business travel   \n",
       "3           3   24026  Female             NaN  25.0  Business travel   \n",
       "4           4  119299    Male             NaN  61.0  Business travel   \n",
       "\n",
       "      Class  Flight Distance  Inflight wifi service  \\\n",
       "0  Eco Plus              460                      3   \n",
       "1  Business              235                      3   \n",
       "2  Business             1142                      2   \n",
       "3  Business              562                      2   \n",
       "4  Business              214                      3   \n",
       "\n",
       "   Departure/Arrival time convenient  ...  Inflight entertainment  \\\n",
       "0                                4.0  ...                     5.0   \n",
       "1                                2.0  ...                     NaN   \n",
       "2                                NaN  ...                     NaN   \n",
       "3                                NaN  ...                     NaN   \n",
       "4                                NaN  ...                     NaN   \n",
       "\n",
       "   On-board service  Leg room service  Baggage handling  Checkin service  \\\n",
       "0                 4                 3                 4                4   \n",
       "1                 1                 5                 3                1   \n",
       "2                 4                 3                 4                4   \n",
       "3                 2                 5                 3                1   \n",
       "4                 3                 4                 4                3   \n",
       "\n",
       "   Inflight service  Cleanliness  Departure Delay in Minutes  \\\n",
       "0               5.0          5.0                        25.0   \n",
       "1               NaN          NaN                         NaN   \n",
       "2               NaN          NaN                         NaN   \n",
       "3               NaN          NaN                         NaN   \n",
       "4               NaN          NaN                         NaN   \n",
       "\n",
       "   Arrival Delay in Minutes  satisfaction  \n",
       "0                      18.0           2.0  \n",
       "1                       6.0           2.0  \n",
       "2                       0.0           NaN  \n",
       "3                       9.0           NaN  \n",
       "4                       0.0           NaN  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('./Airline_passenger_satisfaction.csv')\n",
    "df.columns\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7a5bd329",
   "metadata": {},
   "source": [
    "1.观察数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "331f187f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(129880, 25)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape   # 查看整体数据有多少行多少列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e451cdff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Unnamed: 0                            0.000000\n",
       "id                                    0.000000\n",
       "Gender                                0.000000\n",
       "Customer Type                         0.004620\n",
       "Age                                   0.507391\n",
       "Type of Travel                       28.303049\n",
       "Class                                 0.030798\n",
       "Flight Distance                       0.000000\n",
       "Inflight wifi service                 0.000000\n",
       "Departure/Arrival time convenient     0.003080\n",
       "Ease of Online booking                0.000000\n",
       "Gate location                         0.001540\n",
       "Food and drink                        0.000000\n",
       "Online boarding                       0.000000\n",
       "Seat comfort                          0.004620\n",
       "Inflight entertainment                0.004620\n",
       "On-board service                      0.000000\n",
       "Leg room service                      0.000000\n",
       "Baggage handling                      0.000000\n",
       "Checkin service                       0.000000\n",
       "Inflight service                      0.004620\n",
       "Cleanliness                           0.004620\n",
       "Departure Delay in Minutes            0.004620\n",
       "Arrival Delay in Minutes              0.302587\n",
       "satisfaction                          0.003850\n",
       "dtype: float64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看数据的缺失值情况\n",
    "df.isnull().sum()/df.shape[0] * 100 \n",
    "# 参考80%法则：可以考虑删除Type of Travel列，缺失值大于20%了，其他缺失值的列采用按行删除的方式处理\n",
    "# 从属性的重要程度上考虑可以按行删除缺失值，保留Type of Travel列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d89d5900",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 129880 entries, 0 to 129879\n",
      "Data columns (total 25 columns):\n",
      " #   Column                             Non-Null Count   Dtype  \n",
      "---  ------                             --------------   -----  \n",
      " 0   Unnamed: 0                         129880 non-null  int64  \n",
      " 1   id                                 129880 non-null  int64  \n",
      " 2   Gender                             129880 non-null  object \n",
      " 3   Customer Type                      129874 non-null  object \n",
      " 4   Age                                129221 non-null  float64\n",
      " 5   Type of Travel                     93120 non-null   object \n",
      " 6   Class                              129840 non-null  object \n",
      " 7   Flight Distance                    129880 non-null  int64  \n",
      " 8   Inflight wifi service              129880 non-null  int64  \n",
      " 9   Departure/Arrival time convenient  129876 non-null  float64\n",
      " 10  Ease of Online booking             129880 non-null  int64  \n",
      " 11  Gate location                      129878 non-null  float64\n",
      " 12  Food and drink                     129880 non-null  int64  \n",
      " 13  Online boarding                    129880 non-null  int64  \n",
      " 14  Seat comfort                       129874 non-null  float64\n",
      " 15  Inflight entertainment             129874 non-null  float64\n",
      " 16  On-board service                   129880 non-null  int64  \n",
      " 17  Leg room service                   129880 non-null  int64  \n",
      " 18  Baggage handling                   129880 non-null  int64  \n",
      " 19  Checkin service                    129880 non-null  int64  \n",
      " 20  Inflight service                   129874 non-null  float64\n",
      " 21  Cleanliness                        129874 non-null  float64\n",
      " 22  Departure Delay in Minutes         129874 non-null  float64\n",
      " 23  Arrival Delay in Minutes           129487 non-null  float64\n",
      " 24  satisfaction                       129875 non-null  float64\n",
      "dtypes: float64(10), int64(11), object(4)\n",
      "memory usage: 24.8+ MB\n"
     ]
    }
   ],
   "source": [
    "df.info() #查看数据类型\n",
    "# 通过查看数据类型我们可以看出数据需要进行特征编码： Gender、Customer Type、Type of Travel、Class这几列是object类型，\n",
    "# 而Gender、Customer Type、Type of Travel是二元属性，考虑用label-encoding编码\n",
    "# Class列可以考虑用独热编码，也可以用label-encoding编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "3722b694",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>id</th>\n",
       "      <th>Age</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>Food and drink</th>\n",
       "      <th>Online boarding</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129221.00000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129876.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129878.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>129874.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>129874.000000</td>\n",
       "      <td>129874.000000</td>\n",
       "      <td>129874.000000</td>\n",
       "      <td>129487.000000</td>\n",
       "      <td>129875.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>44158.700000</td>\n",
       "      <td>64940.500000</td>\n",
       "      <td>39.42781</td>\n",
       "      <td>1190.316392</td>\n",
       "      <td>2.728696</td>\n",
       "      <td>3.057586</td>\n",
       "      <td>2.756876</td>\n",
       "      <td>2.976940</td>\n",
       "      <td>3.204774</td>\n",
       "      <td>3.252633</td>\n",
       "      <td>...</td>\n",
       "      <td>3.358124</td>\n",
       "      <td>3.383023</td>\n",
       "      <td>3.350878</td>\n",
       "      <td>3.632114</td>\n",
       "      <td>3.306267</td>\n",
       "      <td>3.642176</td>\n",
       "      <td>3.286370</td>\n",
       "      <td>14.714231</td>\n",
       "      <td>15.091129</td>\n",
       "      <td>1.565536</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>31207.377062</td>\n",
       "      <td>37493.270818</td>\n",
       "      <td>15.11974</td>\n",
       "      <td>997.452477</td>\n",
       "      <td>1.329340</td>\n",
       "      <td>1.526750</td>\n",
       "      <td>1.401740</td>\n",
       "      <td>1.278518</td>\n",
       "      <td>1.329933</td>\n",
       "      <td>1.350719</td>\n",
       "      <td>...</td>\n",
       "      <td>1.334029</td>\n",
       "      <td>1.287099</td>\n",
       "      <td>1.316252</td>\n",
       "      <td>1.180025</td>\n",
       "      <td>1.266185</td>\n",
       "      <td>1.176687</td>\n",
       "      <td>1.313663</td>\n",
       "      <td>38.071916</td>\n",
       "      <td>38.465650</td>\n",
       "      <td>0.495688</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>7.00000</td>\n",
       "      <td>31.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>16234.750000</td>\n",
       "      <td>32470.750000</td>\n",
       "      <td>27.00000</td>\n",
       "      <td>414.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>38963.500000</td>\n",
       "      <td>64940.500000</td>\n",
       "      <td>40.00000</td>\n",
       "      <td>844.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>71433.250000</td>\n",
       "      <td>97410.250000</td>\n",
       "      <td>51.00000</td>\n",
       "      <td>1744.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>12.000000</td>\n",
       "      <td>13.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>103903.000000</td>\n",
       "      <td>129880.000000</td>\n",
       "      <td>85.00000</td>\n",
       "      <td>4983.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>1592.000000</td>\n",
       "      <td>1584.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          Unnamed: 0             id           Age  Flight Distance  \\\n",
       "count  129880.000000  129880.000000  129221.00000    129880.000000   \n",
       "mean    44158.700000   64940.500000      39.42781      1190.316392   \n",
       "std     31207.377062   37493.270818      15.11974       997.452477   \n",
       "min         0.000000       1.000000       7.00000        31.000000   \n",
       "25%     16234.750000   32470.750000      27.00000       414.000000   \n",
       "50%     38963.500000   64940.500000      40.00000       844.000000   \n",
       "75%     71433.250000   97410.250000      51.00000      1744.000000   \n",
       "max    103903.000000  129880.000000      85.00000      4983.000000   \n",
       "\n",
       "       Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "count          129880.000000                      129876.000000   \n",
       "mean                2.728696                           3.057586   \n",
       "std                 1.329340                           1.526750   \n",
       "min                 0.000000                           0.000000   \n",
       "25%                 2.000000                           2.000000   \n",
       "50%                 3.000000                           3.000000   \n",
       "75%                 4.000000                           4.000000   \n",
       "max                 5.000000                           5.000000   \n",
       "\n",
       "       Ease of Online booking  Gate location  Food and drink  Online boarding  \\\n",
       "count           129880.000000  129878.000000   129880.000000    129880.000000   \n",
       "mean                 2.756876       2.976940        3.204774         3.252633   \n",
       "std                  1.401740       1.278518        1.329933         1.350719   \n",
       "min                  0.000000       0.000000        0.000000         0.000000   \n",
       "25%                  2.000000       2.000000        2.000000         2.000000   \n",
       "50%                  3.000000       3.000000        3.000000         3.000000   \n",
       "75%                  4.000000       4.000000        4.000000         4.000000   \n",
       "max                  5.000000       5.000000        5.000000         5.000000   \n",
       "\n",
       "       ...  Inflight entertainment  On-board service  Leg room service  \\\n",
       "count  ...           129874.000000     129880.000000     129880.000000   \n",
       "mean   ...                3.358124          3.383023          3.350878   \n",
       "std    ...                1.334029          1.287099          1.316252   \n",
       "min    ...                0.000000          0.000000          0.000000   \n",
       "25%    ...                2.000000          2.000000          2.000000   \n",
       "50%    ...                4.000000          4.000000          4.000000   \n",
       "75%    ...                4.000000          4.000000          4.000000   \n",
       "max    ...                5.000000          5.000000          5.000000   \n",
       "\n",
       "       Baggage handling  Checkin service  Inflight service    Cleanliness  \\\n",
       "count     129880.000000    129880.000000     129874.000000  129874.000000   \n",
       "mean           3.632114         3.306267          3.642176       3.286370   \n",
       "std            1.180025         1.266185          1.176687       1.313663   \n",
       "min            1.000000         0.000000          0.000000       0.000000   \n",
       "25%            3.000000         3.000000          3.000000       2.000000   \n",
       "50%            4.000000         3.000000          4.000000       3.000000   \n",
       "75%            5.000000         4.000000          5.000000       4.000000   \n",
       "max            5.000000         5.000000          5.000000       5.000000   \n",
       "\n",
       "       Departure Delay in Minutes  Arrival Delay in Minutes   satisfaction  \n",
       "count               129874.000000             129487.000000  129875.000000  \n",
       "mean                    14.714231                 15.091129       1.565536  \n",
       "std                     38.071916                 38.465650       0.495688  \n",
       "min                      0.000000                  0.000000       1.000000  \n",
       "25%                      0.000000                  0.000000       1.000000  \n",
       "50%                      0.000000                  0.000000       2.000000  \n",
       "75%                     12.000000                 13.000000       2.000000  \n",
       "max                   1592.000000               1584.000000       2.000000  \n",
       "\n",
       "[8 rows x 21 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe() # 查看数据的详细信息\n",
    "#在观察数据时发现出发延误时间和到达延误时间有比较大的值，不经常出现可以考虑做异常值处理替换或删除\n",
    "#不同服务评分和出发延误时间以及到达延误时间之间的取值范围差异比较大，可能需要做特征离缩放。标准化：建模后根据评分来决定要不要进行标准化\n",
    "#如果考虑对出发延误时间以及到达延误时间进行离散化那么就不需要进行标准化了。所以一般做了离散化就不需要做标准化了，做了标准化就不需要做离散化了 \n",
    "#一般做了离散化就不需要做标准化和异常值处理了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "db165f13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0    73449\n",
       "1.0    56426\n",
       "Name: satisfaction, dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['satisfaction'].value_counts()  # 观察查目标列有没有数据倾斜，如果没有倾斜我们就不需要做数据不均衡处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "0b69a6a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>id</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Class</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>70172</td>\n",
       "      <td>Male</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>13.0</td>\n",
       "      <td>Personal Travel</td>\n",
       "      <td>Eco Plus</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>5047</td>\n",
       "      <td>Male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>235</td>\n",
       "      <td>3</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>110028</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>1142</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>24026</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>562</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>119299</td>\n",
       "      <td>Male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>214</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0      id  Gender   Customer Type   Age   Type of Travel  \\\n",
       "0           0   70172    Male  Loyal Customer  13.0  Personal Travel   \n",
       "1           1    5047    Male             NaN  25.0  Business travel   \n",
       "2           2  110028  Female             NaN  26.0  Business travel   \n",
       "3           3   24026  Female             NaN  25.0  Business travel   \n",
       "4           4  119299    Male             NaN  61.0  Business travel   \n",
       "\n",
       "      Class  Flight Distance  Inflight wifi service  \\\n",
       "0  Eco Plus              460                      3   \n",
       "1  Business              235                      3   \n",
       "2  Business             1142                      2   \n",
       "3  Business              562                      2   \n",
       "4  Business              214                      3   \n",
       "\n",
       "   Departure/Arrival time convenient  ...  Inflight entertainment  \\\n",
       "0                                4.0  ...                     5.0   \n",
       "1                                2.0  ...                     NaN   \n",
       "2                                NaN  ...                     NaN   \n",
       "3                                NaN  ...                     NaN   \n",
       "4                                NaN  ...                     NaN   \n",
       "\n",
       "   On-board service  Leg room service  Baggage handling  Checkin service  \\\n",
       "0                 4                 3                 4                4   \n",
       "1                 1                 5                 3                1   \n",
       "2                 4                 3                 4                4   \n",
       "3                 2                 5                 3                1   \n",
       "4                 3                 4                 4                3   \n",
       "\n",
       "   Inflight service  Cleanliness  Departure Delay in Minutes  \\\n",
       "0               5.0          5.0                        25.0   \n",
       "1               NaN          NaN                         NaN   \n",
       "2               NaN          NaN                         NaN   \n",
       "3               NaN          NaN                         NaN   \n",
       "4               NaN          NaN                         NaN   \n",
       "\n",
       "   Arrival Delay in Minutes  satisfaction  \n",
       "0                      18.0           2.0  \n",
       "1                       6.0           2.0  \n",
       "2                       0.0           NaN  \n",
       "3                       9.0           NaN  \n",
       "4                       0.0           NaN  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()  #观察数据是不是要做特征选择,也就是考虑需不需要删除某些列\n",
    "# 通过观察可以看出目标列的满意度和 Unnamed: 0、id两列没有多大关联，也就是这两列无实际意义，所以可以考虑做特征选择，进行这两列的删除"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "8c78873c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAGFCAYAAAASI+9IAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAjS0lEQVR4nO3deZzVBb3/8fc5Z2aYhVmBGWAWZBFEFEQFEUxT0aSrqdlupTetn0VebfOWN9dumfdWt1/Zrz3L1Eq9yuIKgmwayCICsu8zMPu+r+f3x9GjGeIwc875fJfX8/HgMWqP9G3avOa7nO83EA6HwwIAQFLQegAAwDmIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAgAgiigAAKKIAhLivvvu04wZM5SZman8/HxdddVV2rVrl/UsAO9CFJAQK1eu1Pz587V27VotXbpUPT09uvTSS9Xa2mo9DcA7BMLhcNh6BPynurpa+fn5Wrlypc4//3zrOQDexJECTDQ2NkqS8vLyjJcAeCeOFJBw4XBYV155perr67V69WrrOQDeIcl6APznq1/9qrZs2aI1a9ZYTwHwLkQBCXXzzTdr0aJFWrVqlYqKiqznAHgXooCECIfDuvnmm/XUU09pxYoVGjt2rPUkAMdAFJAQ8+fP16OPPqqFCxcqMzNTFRUVkqTs7GylpaUZrwPwFi40IyECgcAx//iDDz6o66+/PrFjALwnjhSQEPzsAbgDn1MAAEQRBQBAFFEAAEQRBQBAFFEAAERx9xE8p7cvrJqWTlU3R341dXSrvatX7d2RXx3v+O22rl719YUVDAaUHAwqFAooKRhQKPjW16BSk4PKTktWTnqyctJTlJMW+Zqbnqys1GQFg8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B9ST4BFEAHKi1tVXTpk3TAw88YD0FPsMnbQAHmjdvnubNm2c9Az7EkQIAIIooAACiiAIAIIooAACiiAIAIIq7jwAHamlp0d69e6O/f+DAAW3evFl5eXkqKSkxXAav4ympgAOtWLFCF1544T/98euuu05//OMfEz8IvkEUAABRXFMAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBAFFEAAEQRBQBA1P8HtWg3Rnt7bJQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 用绘图看数据情况-饼图1\n",
    "import matplotlib.pyplot as plt\n",
    "plt.pie(x=df['satisfaction'].value_counts(),labels=[2,1]) #查看目标列的饼图  \n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "29505a21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAGwCAYAAAC0HlECAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA2X0lEQVR4nO3df3SU5Z3//9cYyBhCMoaEzDA1WlxjSprUutENgbZQgQQkRGtXbGNHcqQBGiVNSQqlbi16NFkFga7ZtcBRqaib9hSxWiRNaEs0QgBTUw0GtG00Yc0QlGECaToJ4f7+4cf76yT8uI2Jk9Dn45w5x7mu933f73vOGXmd677njs0wDEMAAAA4p4tC3QAAAMBIQGgCAACwgNAEAABgAaEJAADAAkITAACABYQmAAAACwhNAAAAFowKdQMXktOnT+u9995TVFSUbDZb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271xz74IMP9NZbb2nSpEnnPR8Anw1CE4BhY+/evSotLdWrr76qlpYWPfvsszp69KgmTZqkK6+8Ulu2bFFTU5P27t2r2267rd8qz+c//3n9/ve/l9frNS/rfVxzc7NWrlypPXv26N1331VVVdV5g8mVV16pZ599Vg0NDfrzn/+s3NxcnT59OuiYCxYs0B133KHnnntOzc3N2rVrl371q19Jki6//HLZbDb99re/1dGjR3Xy5Ml+x0hMTNSNN96o/Px81dbW6s9//rO+853v6HOf+5xuvPHGgX6cAAYZoQnAsBEdHa2XXnpJN9xwg6666ir9x3/8hx5++GHNmTNHjz/+uHw+n6655hp5PB4VFhYqPj4+aPuHH35Y1dXVSkhI0DXXXNNv/2PGjNHBgwf1zW9+U1dddZUWLVqku+66S4sXLz5rT+vWrVNMTIymTJmiefPmKSsrS//6r/8aVPPoo4/q3//931VQUKAvfOELys/PV2dnpyTpc5/7nO6991796Ec/ktPp1F133XXG4zzxxBNKS0tTdna2MjIyZBiGXnzxxX6X5ACEDk8EBwAAsICVJgAAAAsITQAAABYQmgAAACwgNAEAAFhAaAIAALCA0AQAAGABoQkAAMACQhMAAIAFhCYAAAALCE0AAAAWEJoAAAAs+P8Af/x+N7Xx6VoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 用seaborn绘图看数据情况-柱状\n",
    "import seaborn as sns\n",
    "sns.countplot(x=df['satisfaction']) #用seaborn不需要自己去统计，而plt的柱状图需要自己去统计，比如用value_counts()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "69107953",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjoAAAGdCAYAAAAbudkLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAA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IAvEKEDY8ViMW3cuFHNzc16++23lZeXN9VLAgB8wQgdGGvDhg06cuSIfvSjHyk9PV3BYFCSZFmWUlNTp3h1AO6VW7du6Wc/+5n98+XLl9Xd3a2srCw9/PDDU7gyPAj4eDmM5XA4brv99ddf15o1a77YxQC4b95++21985vfnLB99erVOnDgwBe/IDxQCB0AAGAsPl4OAACMRegAAABjEToAAMBYhA4AADAWoQMAAIxF6AAAAGMROgAAwFiEDgAAMBahAwAAjEXoAAAAYxE6AADAWIQOAAAw1v8DR3Ok1MTcKVAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 用plt绘图看数据情况-柱状\n",
    "# plt.bar(x=['2','1'],height=[73449,56426])\n",
    "plt.bar(x=['2','1'],height=df['satisfaction'].value_counts()) #用seaborn不需要自己去统计，而plt的柱状图需要自己去统计，比如用value_counts()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08191e57",
   "metadata": {},
   "source": [
    "2.数据处理-根据上面的分析作出处理"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f395de5",
   "metadata": {},
   "source": [
    "2.1缺失值处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "9430cc5d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Unnamed: 0                           0\n",
       "id                                   0\n",
       "Gender                               0\n",
       "Customer Type                        0\n",
       "Age                                  0\n",
       "Type of Travel                       0\n",
       "Class                                0\n",
       "Flight Distance                      0\n",
       "Inflight wifi service                0\n",
       "Departure/Arrival time convenient    0\n",
       "Ease of Online booking               0\n",
       "Gate location                        0\n",
       "Food and drink                       0\n",
       "Online boarding                      0\n",
       "Seat comfort                         0\n",
       "Inflight entertainment               0\n",
       "On-board service                     0\n",
       "Leg room service                     0\n",
       "Baggage handling                     0\n",
       "Checkin service                      0\n",
       "Inflight service                     0\n",
       "Cleanliness                          0\n",
       "Departure Delay in Minutes           0\n",
       "Arrival Delay in Minutes             0\n",
       "satisfaction                         0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop = df.dropna(axis=0,how='any')  # 按行删除缺失值\n",
    "df_drop.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "db7e9059",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(92817, 25)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "13f9b935",
   "metadata": {},
   "source": [
    "2.2.删除无意义的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "3797c179",
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "df_drop.drop(axis=1,columns=['Unnamed: 0','id'],inplace=True)  # inplace在原本的数据上处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "fcdef1f1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Class</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Male</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>13.0</td>\n",
       "      <td>Personal Travel</td>\n",
       "      <td>Eco Plus</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Female</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>52.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Female</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Male</td>\n",
       "      <td>disloyal Customer</td>\n",
       "      <td>20.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Female</td>\n",
       "      <td>disloyal Customer</td>\n",
       "      <td>24.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Gender      Customer Type   Age   Type of Travel     Class  \\\n",
       "0     Male     Loyal Customer  13.0  Personal Travel  Eco Plus   \n",
       "7   Female     Loyal Customer  52.0  Business travel  Business   \n",
       "8   Female     Loyal Customer  41.0  Business travel  Business   \n",
       "9     Male  disloyal Customer  20.0  Business travel       Eco   \n",
       "10  Female  disloyal Customer  24.0  Business travel       Eco   \n",
       "\n",
       "    Flight Distance  Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0               460                      3                                4.0   \n",
       "7              2035                      4                                3.0   \n",
       "8               853                      1                                2.0   \n",
       "9              1061                      3                                3.0   \n",
       "10             1182                      4                                5.0   \n",
       "\n",
       "    Ease of Online booking  Gate location  ...  Inflight entertainment  \\\n",
       "0                        3            1.0  ...                     5.0   \n",
       "7                        4            4.0  ...                     5.0   \n",
       "8                        2            2.0  ...                     1.0   \n",
       "9                        3            4.0  ...                     2.0   \n",
       "10                       5            4.0  ...                     2.0   \n",
       "\n",
       "    On-board service  Leg room service  Baggage handling  Checkin service  \\\n",
       "0                  4                 3                 4                4   \n",
       "7                  5                 5                 5                4   \n",
       "8                  1                 2                 1                4   \n",
       "9                  2                 3                 4                4   \n",
       "10                 3                 3                 5                3   \n",
       "\n",
       "    Inflight service  Cleanliness  Departure Delay in Minutes  \\\n",
       "0                5.0          5.0                        25.0   \n",
       "7                5.0          4.0                         4.0   \n",
       "8                1.0          2.0                         0.0   \n",
       "9                3.0          2.0                         0.0   \n",
       "10               5.0          2.0                         0.0   \n",
       "\n",
       "    Arrival Delay in Minutes  satisfaction  \n",
       "0                       18.0           2.0  \n",
       "7                        0.0           1.0  \n",
       "8                        0.0           2.0  \n",
       "9                        0.0           2.0  \n",
       "10                       0.0           2.0  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f6f08b3f",
   "metadata": {},
   "source": [
    "2.3 离散化处理：对到达延误时间和出发延误时间做离散化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "3159020b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_drop['Departure Delay in Minutes'] = pd.cut(x=df_drop['Departure Delay in Minutes'],bins=6,labels=[1,2,3,4,5,6])  #延误等级划分为6个\n",
    "df_drop['Arrival Delay in Minutes'] = pd.cut(x=df_drop['Arrival Delay in Minutes'],bins=6,labels=[1,2,3,4,5,6])  #延误等级划分为6个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "f11b3b53",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Class</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Male</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>13.0</td>\n",
       "      <td>Personal Travel</td>\n",
       "      <td>Eco Plus</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Female</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>52.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Female</td>\n",
       "      <td>Loyal Customer</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Business</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Male</td>\n",
       "      <td>disloyal Customer</td>\n",
       "      <td>20.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Female</td>\n",
       "      <td>disloyal Customer</td>\n",
       "      <td>24.0</td>\n",
       "      <td>Business travel</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Gender      Customer Type   Age   Type of Travel     Class  \\\n",
       "0     Male     Loyal Customer  13.0  Personal Travel  Eco Plus   \n",
       "7   Female     Loyal Customer  52.0  Business travel  Business   \n",
       "8   Female     Loyal Customer  41.0  Business travel  Business   \n",
       "9     Male  disloyal Customer  20.0  Business travel       Eco   \n",
       "10  Female  disloyal Customer  24.0  Business travel       Eco   \n",
       "\n",
       "    Flight Distance  Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0               460                      3                                4.0   \n",
       "7              2035                      4                                3.0   \n",
       "8               853                      1                                2.0   \n",
       "9              1061                      3                                3.0   \n",
       "10             1182                      4                                5.0   \n",
       "\n",
       "    Ease of Online booking  Gate location  ...  Inflight entertainment  \\\n",
       "0                        3            1.0  ...                     5.0   \n",
       "7                        4            4.0  ...                     5.0   \n",
       "8                        2            2.0  ...                     1.0   \n",
       "9                        3            4.0  ...                     2.0   \n",
       "10                       5            4.0  ...                     2.0   \n",
       "\n",
       "    On-board service  Leg room service  Baggage handling  Checkin service  \\\n",
       "0                  4                 3                 4                4   \n",
       "7                  5                 5                 5                4   \n",
       "8                  1                 2                 1                4   \n",
       "9                  2                 3                 4                4   \n",
       "10                 3                 3                 5                3   \n",
       "\n",
       "    Inflight service  Cleanliness  Departure Delay in Minutes  \\\n",
       "0                5.0          5.0                           1   \n",
       "7                5.0          4.0                           1   \n",
       "8                1.0          2.0                           1   \n",
       "9                3.0          2.0                           1   \n",
       "10               5.0          2.0                           1   \n",
       "\n",
       "    Arrival Delay in Minutes  satisfaction  \n",
       "0                          1           2.0  \n",
       "7                          1           1.0  \n",
       "8                          1           2.0  \n",
       "9                          1           2.0  \n",
       "10                         1           2.0  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "32314282",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 92817 entries, 0 to 129839\n",
      "Data columns (total 23 columns):\n",
      " #   Column                             Non-Null Count  Dtype   \n",
      "---  ------                             --------------  -----   \n",
      " 0   Gender                             92817 non-null  object  \n",
      " 1   Customer Type                      92817 non-null  object  \n",
      " 2   Age                                92817 non-null  float64 \n",
      " 3   Type of Travel                     92817 non-null  object  \n",
      " 4   Class                              92817 non-null  object  \n",
      " 5   Flight Distance                    92817 non-null  int64   \n",
      " 6   Inflight wifi service              92817 non-null  int64   \n",
      " 7   Departure/Arrival time convenient  92817 non-null  float64 \n",
      " 8   Ease of Online booking             92817 non-null  int64   \n",
      " 9   Gate location                      92817 non-null  float64 \n",
      " 10  Food and drink                     92817 non-null  int64   \n",
      " 11  Online boarding                    92817 non-null  int64   \n",
      " 12  Seat comfort                       92817 non-null  float64 \n",
      " 13  Inflight entertainment             92817 non-null  float64 \n",
      " 14  On-board service                   92817 non-null  int64   \n",
      " 15  Leg room service                   92817 non-null  int64   \n",
      " 16  Baggage handling                   92817 non-null  int64   \n",
      " 17  Checkin service                    92817 non-null  int64   \n",
      " 18  Inflight service                   92817 non-null  float64 \n",
      " 19  Cleanliness                        92817 non-null  float64 \n",
      " 20  Departure Delay in Minutes         92817 non-null  category\n",
      " 21  Arrival Delay in Minutes           92817 non-null  category\n",
      " 22  satisfaction                       92817 non-null  float64 \n",
      "dtypes: category(2), float64(8), int64(9), object(4)\n",
      "memory usage: 15.8+ MB\n"
     ]
    }
   ],
   "source": [
    "df_drop.info()\n",
    "#发现Departure Delay in Minutes，Arrival Delay in Minutes两列数据类型还不是数值类型，而是category类型，所以为了之后做处理，得先转型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "7cf2251d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 对离散化后的数据进行类型转换，因为离散后的数据类型发生了变化\n",
    "df_drop['Departure Delay in Minutes'] = df_drop['Departure Delay in Minutes'].astype(np.int64) #转成整形\n",
    "df_drop['Arrival Delay in Minutes'] = df_drop['Arrival Delay in Minutes'].astype(np.int64) #转成整形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "1110eedc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 92817 entries, 0 to 129839\n",
      "Data columns (total 23 columns):\n",
      " #   Column                             Non-Null Count  Dtype  \n",
      "---  ------                             --------------  -----  \n",
      " 0   Gender                             92817 non-null  object \n",
      " 1   Customer Type                      92817 non-null  object \n",
      " 2   Age                                92817 non-null  float64\n",
      " 3   Type of Travel                     92817 non-null  object \n",
      " 4   Class                              92817 non-null  object \n",
      " 5   Flight Distance                    92817 non-null  int64  \n",
      " 6   Inflight wifi service              92817 non-null  int64  \n",
      " 7   Departure/Arrival time convenient  92817 non-null  float64\n",
      " 8   Ease of Online booking             92817 non-null  int64  \n",
      " 9   Gate location                      92817 non-null  float64\n",
      " 10  Food and drink                     92817 non-null  int64  \n",
      " 11  Online boarding                    92817 non-null  int64  \n",
      " 12  Seat comfort                       92817 non-null  float64\n",
      " 13  Inflight entertainment             92817 non-null  float64\n",
      " 14  On-board service                   92817 non-null  int64  \n",
      " 15  Leg room service                   92817 non-null  int64  \n",
      " 16  Baggage handling                   92817 non-null  int64  \n",
      " 17  Checkin service                    92817 non-null  int64  \n",
      " 18  Inflight service                   92817 non-null  float64\n",
      " 19  Cleanliness                        92817 non-null  float64\n",
      " 20  Departure Delay in Minutes         92817 non-null  int64  \n",
      " 21  Arrival Delay in Minutes           92817 non-null  int64  \n",
      " 22  satisfaction                       92817 non-null  float64\n",
      "dtypes: float64(8), int64(11), object(4)\n",
      "memory usage: 17.0+ MB\n"
     ]
    }
   ],
   "source": [
    "df_drop.info()   #查看已经转成整形"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c2b635fe",
   "metadata": {},
   "source": [
    "2.4 进行特征编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "f4c7ec33",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Business travel    64235\n",
       "Personal Travel    28582\n",
       "Name: Type of Travel, dtype: int64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop['Type of Travel'].value_counts() #用来查看上面的二元属性有哪几个值，好映射"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "a106ae01",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 通过查看数据类型我们可以看出数据需要进行特征编码： Gender、Customer Type、Type of Travel、Class这几列是object类型，\n",
    "# 而Gender、Customer Type、Type of Travel是二元属性，考虑用label-encoding编码\n",
    "df_drop['Gender'] = df_drop['Gender'].map({'Male':0,'Female':1})\n",
    "df_drop['Customer Type'] = df_drop['Customer Type'].map({'Loyal Customer':0,'disloyal Customer':1})\n",
    "df_drop['Type of Travel'] = df_drop['Type of Travel'].map({'Business travel':0,'Personal Travel':1})\n",
    "# df_drop['Class']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3640dad3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Class</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>...</th>\n",
       "      <th>Inflight entertainment</th>\n",
       "      <th>On-board service</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Eco Plus</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>0</td>\n",
       "      <td>Business</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>Business</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0</td>\n",
       "      <td>Eco</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Gender  Customer Type   Age  Type of Travel     Class  Flight Distance  \\\n",
       "0        0              0  13.0               1  Eco Plus              460   \n",
       "7        1              0  52.0               0  Business             2035   \n",
       "8        1              0  41.0               0  Business              853   \n",
       "9        0              1  20.0               0       Eco             1061   \n",
       "10       1              1  24.0               0       Eco             1182   \n",
       "\n",
       "    Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0                       3                                4.0   \n",
       "7                       4                                3.0   \n",
       "8                       1                                2.0   \n",
       "9                       3                                3.0   \n",
       "10                      4                                5.0   \n",
       "\n",
       "    Ease of Online booking  Gate location  ...  Inflight entertainment  \\\n",
       "0                        3            1.0  ...                     5.0   \n",
       "7                        4            4.0  ...                     5.0   \n",
       "8                        2            2.0  ...                     1.0   \n",
       "9                        3            4.0  ...                     2.0   \n",
       "10                       5            4.0  ...                     2.0   \n",
       "\n",
       "    On-board service  Leg room service  Baggage handling  Checkin service  \\\n",
       "0                  4                 3                 4                4   \n",
       "7                  5                 5                 5                4   \n",
       "8                  1                 2                 1                4   \n",
       "9                  2                 3                 4                4   \n",
       "10                 3                 3                 5                3   \n",
       "\n",
       "    Inflight service  Cleanliness  Departure Delay in Minutes  \\\n",
       "0                5.0          5.0                           1   \n",
       "7                5.0          4.0                           1   \n",
       "8                1.0          2.0                           1   \n",
       "9                3.0          2.0                           1   \n",
       "10               5.0          2.0                           1   \n",
       "\n",
       "    Arrival Delay in Minutes  satisfaction  \n",
       "0                          1           2.0  \n",
       "7                          1           1.0  \n",
       "8                          1           2.0  \n",
       "9                          1           2.0  \n",
       "10                         1           2.0  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_drop.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "fded0e4c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Class列可以考虑用独热编码，也可以用label-encoding编码,这里用独热编码\n",
    "df_oh = pd.get_dummies(df_drop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "d9d5eab6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>Food and drink</th>\n",
       "      <th>...</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "      <th>Class_Business</th>\n",
       "      <th>Class_Eco</th>\n",
       "      <th>Class_Eco Plus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Gender  Customer Type   Age  Type of Travel  Flight Distance  \\\n",
       "0        0              0  13.0               1              460   \n",
       "7        1              0  52.0               0             2035   \n",
       "8        1              0  41.0               0              853   \n",
       "9        0              1  20.0               0             1061   \n",
       "10       1              1  24.0               0             1182   \n",
       "\n",
       "    Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0                       3                                4.0   \n",
       "7                       4                                3.0   \n",
       "8                       1                                2.0   \n",
       "9                       3                                3.0   \n",
       "10                      4                                5.0   \n",
       "\n",
       "    Ease of Online booking  Gate location  Food and drink  ...  \\\n",
       "0                        3            1.0               5  ...   \n",
       "7                        4            4.0               5  ...   \n",
       "8                        2            2.0               4  ...   \n",
       "9                        3            4.0               2  ...   \n",
       "10                       5            4.0               2  ...   \n",
       "\n",
       "    Baggage handling  Checkin service  Inflight service  Cleanliness  \\\n",
       "0                  4                4               5.0          5.0   \n",
       "7                  5                4               5.0          4.0   \n",
       "8                  1                4               1.0          2.0   \n",
       "9                  4                4               3.0          2.0   \n",
       "10                 5                3               5.0          2.0   \n",
       "\n",
       "    Departure Delay in Minutes  Arrival Delay in Minutes  satisfaction  \\\n",
       "0                            1                         1           2.0   \n",
       "7                            1                         1           1.0   \n",
       "8                            1                         1           2.0   \n",
       "9                            1                         1           2.0   \n",
       "10                           1                         1           2.0   \n",
       "\n",
       "    Class_Business  Class_Eco  Class_Eco Plus  \n",
       "0                0          0               1  \n",
       "7                1          0               0  \n",
       "8                1          0               0  \n",
       "9                0          1               0  \n",
       "10               0          1               0  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_oh.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "57b6841d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>Food and drink</th>\n",
       "      <th>...</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>satisfaction</th>\n",
       "      <th>Class_Business</th>\n",
       "      <th>Class_Eco</th>\n",
       "      <th>Class_Eco Plus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129835</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1979</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129836</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>0</td>\n",
       "      <td>3701</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129837</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>529</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129838</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2748</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129839</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2291</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>92817 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Gender  Customer Type   Age  Type of Travel  Flight Distance  \\\n",
       "0            0              0  13.0               1              460   \n",
       "7            1              0  52.0               0             2035   \n",
       "8            1              0  41.0               0              853   \n",
       "9            0              1  20.0               0             1061   \n",
       "10           1              1  24.0               0             1182   \n",
       "...        ...            ...   ...             ...              ...   \n",
       "129835       1              0  51.0               0             1979   \n",
       "129836       0              0  46.0               0             3701   \n",
       "129837       1              0  22.0               1              529   \n",
       "129838       1              0  41.0               0             2748   \n",
       "129839       1              0  39.0               0             2291   \n",
       "\n",
       "        Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0                           3                                4.0   \n",
       "7                           4                                3.0   \n",
       "8                           1                                2.0   \n",
       "9                           3                                3.0   \n",
       "10                          4                                5.0   \n",
       "...                       ...                                ...   \n",
       "129835                      3                                3.0   \n",
       "129836                      4                                4.0   \n",
       "129837                      3                                5.0   \n",
       "129838                      1                                2.0   \n",
       "129839                      2                                2.0   \n",
       "\n",
       "        Ease of Online booking  Gate location  Food and drink  ...  \\\n",
       "0                            3            1.0               5  ...   \n",
       "7                            4            4.0               5  ...   \n",
       "8                            2            2.0               4  ...   \n",
       "9                            3            4.0               2  ...   \n",
       "10                           5            4.0               2  ...   \n",
       "...                        ...            ...             ...  ...   \n",
       "129835                       3            3.0               2  ...   \n",
       "129836                       4            4.0               4  ...   \n",
       "129837                       3            4.0               3  ...   \n",
       "129838                       2            2.0               1  ...   \n",
       "129839                       1            1.0               5  ...   \n",
       "\n",
       "        Baggage handling  Checkin service  Inflight service  Cleanliness  \\\n",
       "0                      4                4               5.0          5.0   \n",
       "7                      5                4               5.0          4.0   \n",
       "8                      1                4               1.0          2.0   \n",
       "9                      4                4               3.0          2.0   \n",
       "10                     5                3               5.0          2.0   \n",
       "...                  ...              ...               ...          ...   \n",
       "129835                 5                3               5.0          3.0   \n",
       "129836                 4                5               4.0          3.0   \n",
       "129837                 4                5               5.0          3.0   \n",
       "129838                 1                3               1.0          3.0   \n",
       "129839                 2                1               2.0          1.0   \n",
       "\n",
       "        Departure Delay in Minutes  Arrival Delay in Minutes  satisfaction  \\\n",
       "0                                1                         1           2.0   \n",
       "7                                1                         1           1.0   \n",
       "8                                1                         1           2.0   \n",
       "9                                1                         1           2.0   \n",
       "10                               1                         1           2.0   \n",
       "...                            ...                       ...           ...   \n",
       "129835                           1                         1           1.0   \n",
       "129836                           1                         1           1.0   \n",
       "129837                           1                         1           2.0   \n",
       "129838                           1                         1           2.0   \n",
       "129839                           1                         1           2.0   \n",
       "\n",
       "        Class_Business  Class_Eco  Class_Eco Plus  \n",
       "0                    0          0               1  \n",
       "7                    1          0               0  \n",
       "8                    1          0               0  \n",
       "9                    0          1               0  \n",
       "10                   0          1               0  \n",
       "...                ...        ...             ...  \n",
       "129835               1          0               0  \n",
       "129836               1          0               0  \n",
       "129837               0          1               0  \n",
       "129838               1          0               0  \n",
       "129839               1          0               0  \n",
       "\n",
       "[92817 rows x 25 columns]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_oh"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e4957e0f",
   "metadata": {},
   "source": [
    "2.5 数据拆分"
   ]
  },
  {
   "cell_type": "raw",
   "id": "55a5ff3e",
   "metadata": {},
   "source": [
    "数据拆分：\n",
    "    只在有监督学习(分类和回归)中才需要对数据进行拆分。会将数据拆分成训练集和测试集。训练集用于训练模型，测试集用于模型是否可靠。\n",
    "    比如：\n",
    "        现在有1000道题(实际上包含了答案)：700道题学习，300道题测试：用原本的答案和做出来的答案比较\n",
    "    验证集：用来验证模型是否可靠的(不常用)，等于把数据集拆成3份，训练集、测试集、验证集\n",
    "    过程：\n",
    "        纵向拆分：按照目标列和其他列拆分出两份数据，也可以看成按列拆分。X:除目标列以外的数据 y:目标列，可以让模型知道按照什么学习\n",
    "        横向拆分：将数据在纵向拆分基础之上再拆分出训练集和测试集。训练集和测试集的拆分比例一般为6:4或者7:3或者6.4:3.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "6cd70477",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 纵向拆分\n",
    "X = df_oh.drop(axis=1,columns='satisfaction')  #删掉目标列就得到了非目标列\n",
    "y = df_oh['satisfaction']  #只有目标列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "c68a40d5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>Food and drink</th>\n",
       "      <th>...</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>Class_Business</th>\n",
       "      <th>Class_Eco</th>\n",
       "      <th>Class_Eco Plus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1</td>\n",
       "      <td>460</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2035</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>853</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1061</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1182</td>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129835</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1979</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129836</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>0</td>\n",
       "      <td>3701</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129837</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>529</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129838</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2748</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129839</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2291</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>92817 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Gender  Customer Type   Age  Type of Travel  Flight Distance  \\\n",
       "0            0              0  13.0               1              460   \n",
       "7            1              0  52.0               0             2035   \n",
       "8            1              0  41.0               0              853   \n",
       "9            0              1  20.0               0             1061   \n",
       "10           1              1  24.0               0             1182   \n",
       "...        ...            ...   ...             ...              ...   \n",
       "129835       1              0  51.0               0             1979   \n",
       "129836       0              0  46.0               0             3701   \n",
       "129837       1              0  22.0               1              529   \n",
       "129838       1              0  41.0               0             2748   \n",
       "129839       1              0  39.0               0             2291   \n",
       "\n",
       "        Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "0                           3                                4.0   \n",
       "7                           4                                3.0   \n",
       "8                           1                                2.0   \n",
       "9                           3                                3.0   \n",
       "10                          4                                5.0   \n",
       "...                       ...                                ...   \n",
       "129835                      3                                3.0   \n",
       "129836                      4                                4.0   \n",
       "129837                      3                                5.0   \n",
       "129838                      1                                2.0   \n",
       "129839                      2                                2.0   \n",
       "\n",
       "        Ease of Online booking  Gate location  Food and drink  ...  \\\n",
       "0                            3            1.0               5  ...   \n",
       "7                            4            4.0               5  ...   \n",
       "8                            2            2.0               4  ...   \n",
       "9                            3            4.0               2  ...   \n",
       "10                           5            4.0               2  ...   \n",
       "...                        ...            ...             ...  ...   \n",
       "129835                       3            3.0               2  ...   \n",
       "129836                       4            4.0               4  ...   \n",
       "129837                       3            4.0               3  ...   \n",
       "129838                       2            2.0               1  ...   \n",
       "129839                       1            1.0               5  ...   \n",
       "\n",
       "        Leg room service  Baggage handling  Checkin service  Inflight service  \\\n",
       "0                      3                 4                4               5.0   \n",
       "7                      5                 5                4               5.0   \n",
       "8                      2                 1                4               1.0   \n",
       "9                      3                 4                4               3.0   \n",
       "10                     3                 5                3               5.0   \n",
       "...                  ...               ...              ...               ...   \n",
       "129835                 5                 5                3               5.0   \n",
       "129836                 4                 4                5               4.0   \n",
       "129837                 5                 4                5               5.0   \n",
       "129838                 1                 1                3               1.0   \n",
       "129839                 2                 2                1               2.0   \n",
       "\n",
       "        Cleanliness  Departure Delay in Minutes  Arrival Delay in Minutes  \\\n",
       "0               5.0                           1                         1   \n",
       "7               4.0                           1                         1   \n",
       "8               2.0                           1                         1   \n",
       "9               2.0                           1                         1   \n",
       "10              2.0                           1                         1   \n",
       "...             ...                         ...                       ...   \n",
       "129835          3.0                           1                         1   \n",
       "129836          3.0                           1                         1   \n",
       "129837          3.0                           1                         1   \n",
       "129838          3.0                           1                         1   \n",
       "129839          1.0                           1                         1   \n",
       "\n",
       "        Class_Business  Class_Eco  Class_Eco Plus  \n",
       "0                    0          0               1  \n",
       "7                    1          0               0  \n",
       "8                    1          0               0  \n",
       "9                    0          1               0  \n",
       "10                   0          1               0  \n",
       "...                ...        ...             ...  \n",
       "129835               1          0               0  \n",
       "129836               1          0               0  \n",
       "129837               0          1               0  \n",
       "129838               1          0               0  \n",
       "129839               1          0               0  \n",
       "\n",
       "[92817 rows x 24 columns]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X   #少了1列，目标列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "4c9e3440",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0         2.0\n",
       "7         1.0\n",
       "8         2.0\n",
       "9         2.0\n",
       "10        2.0\n",
       "         ... \n",
       "129835    1.0\n",
       "129836    1.0\n",
       "129837    2.0\n",
       "129838    2.0\n",
       "129839    2.0\n",
       "Name: satisfaction, Length: 92817, dtype: float64"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y  #只有1列，目标列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "11e04a23",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 横向拆分\n",
    "from sklearn.model_selection import train_test_split   #train_test_split:训练集测试集拆分\n",
    "#random_state:随机种子，可以随便填，可以保证随机采样得到相同的结果，也就是运行多次下面代码，会保证拆分的数据一样\n",
    "X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3,random_state=12)  #test_size测试集占30%，相当于训练集和测试集7:3来拆分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "c3256c85",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>Customer Type</th>\n",
       "      <th>Age</th>\n",
       "      <th>Type of Travel</th>\n",
       "      <th>Flight Distance</th>\n",
       "      <th>Inflight wifi service</th>\n",
       "      <th>Departure/Arrival time convenient</th>\n",
       "      <th>Ease of Online booking</th>\n",
       "      <th>Gate location</th>\n",
       "      <th>Food and drink</th>\n",
       "      <th>...</th>\n",
       "      <th>Leg room service</th>\n",
       "      <th>Baggage handling</th>\n",
       "      <th>Checkin service</th>\n",
       "      <th>Inflight service</th>\n",
       "      <th>Cleanliness</th>\n",
       "      <th>Departure Delay in Minutes</th>\n",
       "      <th>Arrival Delay in Minutes</th>\n",
       "      <th>Class_Business</th>\n",
       "      <th>Class_Eco</th>\n",
       "      <th>Class_Eco Plus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>124955</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>0</td>\n",
       "      <td>416</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24856</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2226</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64881</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>1</td>\n",
       "      <td>737</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>1</td>\n",
       "      <td>227</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69899</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>37.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1290</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>108362</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0</td>\n",
       "      <td>337</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54366</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>0</td>\n",
       "      <td>391</td>\n",
       "      <td>4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58070</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>67.0</td>\n",
       "      <td>1</td>\n",
       "      <td>404</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26141</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1</td>\n",
       "      <td>592</td>\n",
       "      <td>3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113054</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>63.0</td>\n",
       "      <td>1</td>\n",
       "      <td>594</td>\n",
       "      <td>4</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>64971 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Gender  Customer Type   Age  Type of Travel  Flight Distance  \\\n",
       "124955       1              0  53.0               0              416   \n",
       "24856        0              0  28.0               0             2226   \n",
       "64881        1              0  51.0               1              737   \n",
       "109665       0              0  21.0               1              227   \n",
       "69899        1              1  37.0               0             1290   \n",
       "...        ...            ...   ...             ...              ...   \n",
       "108362       1              0  50.0               0              337   \n",
       "54366        1              0  76.0               0              391   \n",
       "58070        0              0  67.0               1              404   \n",
       "26141        0              0  14.0               1              592   \n",
       "113054       1              0  63.0               1              594   \n",
       "\n",
       "        Inflight wifi service  Departure/Arrival time convenient  \\\n",
       "124955                      4                                3.0   \n",
       "24856                       1                                1.0   \n",
       "64881                       4                                1.0   \n",
       "109665                      4                                4.0   \n",
       "69899                       3                                3.0   \n",
       "...                       ...                                ...   \n",
       "108362                      0                                0.0   \n",
       "54366                       4                                1.0   \n",
       "58070                       3                                5.0   \n",
       "26141                       3                                5.0   \n",
       "113054                      4                                4.0   \n",
       "\n",
       "        Ease of Online booking  Gate location  Food and drink  ...  \\\n",
       "124955                       3            3.0               3  ...   \n",
       "24856                        1            1.0               5  ...   \n",
       "64881                        4            2.0               5  ...   \n",
       "109665                       0            3.0               3  ...   \n",
       "69899                        3            3.0               4  ...   \n",
       "...                        ...            ...             ...  ...   \n",
       "108362                       0            1.0               2  ...   \n",
       "54366                        1            1.0               3  ...   \n",
       "58070                        4            3.0               4  ...   \n",
       "26141                        3            4.0               2  ...   \n",
       "113054                       4            3.0               3  ...   \n",
       "\n",
       "        Leg room service  Baggage handling  Checkin service  Inflight service  \\\n",
       "124955                 4                 4                1               4.0   \n",
       "24856                  5                 1                5               1.0   \n",
       "64881                  4                 2                3               2.0   \n",
       "109665                 3                 4                5               4.0   \n",
       "69899                  2                 4                4               4.0   \n",
       "...                  ...               ...              ...               ...   \n",
       "108362                 2                 2                5               2.0   \n",
       "54366                  4                 4                1               4.0   \n",
       "58070                  2                 4                5               4.0   \n",
       "26141                  3                 4                2               2.0   \n",
       "113054                 4                 3                5               3.0   \n",
       "\n",
       "        Cleanliness  Departure Delay in Minutes  Arrival Delay in Minutes  \\\n",
       "124955          3.0                           1                         1   \n",
       "24856           5.0                           1                         1   \n",
       "64881           1.0                           1                         1   \n",
       "109665          3.0                           1                         1   \n",
       "69899           4.0                           1                         1   \n",
       "...             ...                         ...                       ...   \n",
       "108362          5.0                           1                         1   \n",
       "54366           3.0                           1                         1   \n",
       "58070           4.0                           1                         1   \n",
       "26141           2.0                           1                         1   \n",
       "113054          5.0                           1                         1   \n",
       "\n",
       "        Class_Business  Class_Eco  Class_Eco Plus  \n",
       "124955               0          1               0  \n",
       "24856                1          0               0  \n",
       "64881                0          1               0  \n",
       "109665               0          1               0  \n",
       "69899                1          0               0  \n",
       "...                ...        ...             ...  \n",
       "108362               1          0               0  \n",
       "54366                0          1               0  \n",
       "58070                0          1               0  \n",
       "26141                0          0               1  \n",
       "113054               0          1               0  \n",
       "\n",
       "[64971 rows x 24 columns]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c42c0b78",
   "metadata": {},
   "source": [
    "3.建模"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2211c32d",
   "metadata": {},
   "source": [
    "3.1建模-使用KNN算法建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "1023ee5f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>KNeighborsClassifier(n_neighbors=7)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">KNeighborsClassifier</label><div class=\"sk-toggleable__content\"><pre>KNeighborsClassifier(n_neighbors=7)</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "KNeighborsClassifier(n_neighbors=7)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier    #neighbors邻居的意思  KNeighborsClassifier分类算法\n",
    "# from sklearn.neighbors import KNeighborsRegressor     #KNeighborsRegressor回归算法\n",
    "# 建模训练步骤：1.指定参数建模 2.训练\n",
    "# 1.指定参数\n",
    "model_knn = KNeighborsClassifier(n_neighbors=7)      #n_neighbors 表示最近的多少个样本,默认5个，相当于K值，weights：距离度量方式\n",
    "# 2.训练\n",
    "model_knn.fit(X=X_train,y=y_train)    # 训练的时候只有fit方法，没有fit_transform方法,训练就用上面的训练数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "31fdf2a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7972060619119443"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#模型评分\n",
    "model_knn.score(X=X_test,y=y_test) # 评分就用上面的测试数据集  评分取值范围0-1，越大越好"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
